Skip to content

fix: resolve all failing tests across utility library#161

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2368-1779433691
Open

fix: resolve all failing tests across utility library#161
stooit wants to merge 1 commit into
mainfrom
quantcode/job-e2e-tier1-2368-1779433691

Conversation

@stooit
Copy link
Copy Markdown
Contributor

@stooit stooit commented May 22, 2026

Summary

  • calculator.ts: divide now throws on division by zero instead of returning Infinity
  • string-utils.ts: Fixed wordCount to handle consecutive whitespace; implemented truncate with word-boundary logic
  • task-manager.ts: Implemented remove, update, and sortBy methods
  • date-utils.ts: Fixed off-by-one in formatRelative (uses Math.round so 36h → "2 days ago")
  • validator.ts: Fixed isEmail to allow long TLDs (.museum); fixed isUrl to allow port numbers

Test Results

All 60 tests pass, 0 failures, 70 expect() calls.

Assumptions

  • truncate truncates at word boundary with "..." appended (total length ≤ maxLength)
  • sortBy("priority") orders high > medium > low
  • sortBy("createdAt") orders oldest first
  • formatRelative uses Math.round for day calculation

- calculator: throw on division by zero instead of returning Infinity
- string-utils: fix wordCount for consecutive spaces, implement truncate
- task-manager: implement remove, update, and sortBy methods
- date-utils: use Math.round for days calculation (36h = 2 days)
- validator: allow long TLDs in isEmail, allow ports in isUrl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant